<admintpl file="headerEx" />

<title>{:L("LOCK_SCREEN")} Power By www.tcioc.com </title>

<link href="__PUBLIC__/TciocEx/css/style.css" rel="stylesheet">
<link href="__PUBLIC__/TciocEx/css/style-responsive.css" rel="stylesheet">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="__PUBLIC__/TciocEx/js/html5shiv.js"></script>
<script src="__PUBLIC__/TciocEx/js/respond.min.js"></script>
<![endif]-->
<style>
	.msg-error{color: red}
	.msg-success{color: green}
</style>
</head>

<body class="lock-screen">

<div class="lock-wrapper">
	<div class="panel lock-box text-center">
		<if condition="$admin['avatar']">
			<img alt="lock avatar" width="103" src="{:sp_get_user_avatar_url($admin['avatar'])}">
			<else />
			<img alt="lock avatar" width="103" src="__PUBLIC__/images/default-head-man.jpg">
		</if>
		<div class="locked">
			<i class="fa fa-lock"></i>
		</div>
		<h1>{:L("LOCK_SCREEN_LOGIN_USER_NAME")}:{$admin.user_login}</h1>
		<div class="row">
			<form action="{:U('public/dologin')}" method="post" name="unLock" class="form-inline js-ajax-form" autoComplete="off"  role="form">
				<div class="form-group col-md-12 col-sm-12 col-xs-12">
					<input type="password" class="form-control lock-input" name="pwd" autofocus autocomplete="on"  placeholder="{:L('LOCK_SCREEN_LOGIN_PWD_ALERT')}">
					<button class="btn btn-lock pull-right js-ajax-submit" type="button" data-loadingmsg="{:L('LOADING')}">
						<i class="fa fa-check"></i>
					</button>
					<br>
					<span class="msg"></span>
				</div>
			</form>
		</div>
	</div>
</div>

<!-- Placed js at the end of the document so the pages load faster -->

<!-- Placed js at the end of the document so the pages load faster -->
<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script>
	$(function() {
		$("button.js-ajax-submit").click(unlock)
		$('input[name="pwd"]').keydown(function(event){
			if(event.which==13){
				unlock();
				return false;
			}
		});
	});
	function unlock(){
		$("span.msg").html("");
		$("span.msg").removeClass("msg-error");
		$("span.msg").removeClass("msg-success");
		var btn = $("button.js-ajax-submit"),form = btn.parents('form.js-ajax-form'),url=form.attr("action"),method=form.attr("method");
		$.post(url,{pwd:$('input[name="pwd"]').val()},function(msg){
			if(msg.status==1){
				$("span.msg").addClass("msg-success");
				$("span.msg").html(msg.info);
				setInterval(function(){
					location.href=msg.url;
				},1000);
			}else{
				$("span.msg").addClass("msg-error");
				$("span.msg").html(msg.info);
			}
		});
	}
</script>

</body>
</html>
